import scala.io.StdIn._
object Practise1{
  def averageOfListBelowN(list: List[Int], n: Int): Double = {
    val filteredList = list.filter(_ < n)
    if (filteredList.isEmpty) {
      0
    } else {
      return filteredList.sum.toDouble / filteredList.length.toDouble
    }
  }
  def main(args:Array[String]):Unit={
    val list=List(25,78,14,37,89,3,5,8)
    print("请输入一个整数:")
    val n=readInt()
    println(averageOfListBelowN(list,n))
  }
}
